|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectcontrolP5.Controller
controlP5.Textlabel
public class Textlabel
a textlabel is an image containing text rendered from a bitfont source image. available bit fonts are: standard56, standard58, synt24, grixel. the font of a textlabel can be changed by using setFont(int theFontIndex) theFontIndex is of type int and available indexes are stored in the constants ControlP5.standard56, ControlP5.standard58, ControlP5.synt24, ControlP5.grixel available characters for each pixelfont range from ascii code 32-126 http://www.asciitable.com/
/**
* ControlP5 TextLabel
* by andreas schlegel, 2009
*/
import controlP5.*;
ControlP5 controlP5;
Textlabel myTextlabelA;
Textlabel myTextlabelB;
void setup() {
size(400,400);
frameRate(30);
controlP5 = new ControlP5(this);
controlP5.setControlFont(new ControlFont(createFont("Georgia",20), 20));
myTextlabelA = controlP5.addTextlabel("label","A SINGLE TESTLABEL.",20,134);
myTextlabelA.setColorValue(0xffcccccc);
myTextlabelB = new Textlabel(this,"a single textlabel big stuff.",20,20,400,200);
}
void draw() {
background(0);
myTextlabelB.draw(this);
}
| Field Summary |
|---|
| Fields inherited from interface controlP5.ControlP5Constants |
|---|
acceptClassList, ACTIVE, ALT, ARC, ARRAY, BACKSPACE, BOOLEAN, BOTTOM, CENTER, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, DOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IMAGE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LINE, LOAD, MENU, METHOD, MOVE, OVER, PI, PRESSED, PRINT, RELEASE, RESET, RIGHT, SAVE, SHIFT, SPRITE, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, TAB, TOP, TWO_PI, UP, VERBOSE, VERTICAL |
| Constructor Summary | |
|---|---|
Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY)
.. |
|
Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY,
int theW,
int theH)
|
|
Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY,
int theW,
int theH,
int theColor,
int theFont)
.. |
|
| Method Summary | |
|---|---|
void |
addToXMLElement(ControlP5XMLElement theElement)
|
void |
draw(processing.core.PApplet theApplet)
draw the textlabel. |
ControlFont |
setControlFont(ControlFont theControlFont)
|
void |
setFont(int theFont)
a textlabel is an image containing text rendered from a bitfont source image. |
Controller |
setHeight(int theValue)
|
Textlabel |
setLetterSpacing(int theValue)
set the letter spacing of the font. |
void |
setPosition(float theX,
float theY)
set the position of the textlabel. |
void |
setValue(float theValue)
set the value of the controller. |
Textlabel |
setValue(java.lang.String theText)
set the text of the textlabel. |
Controller |
setWidth(int theValue)
|
void |
update()
updates the value of the controller without having to set the value explicitly. |
Label |
valueLabel()
returns the caption label of the controller. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY,
int theW,
int theH,
int theColor,
int theFont)
theComponent - PApplettheValue - StringtheX - inttheY - inttheW - inttheH - inttheColor - inttheFont - int
public Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY)
theComponent - PApplettheValue - StringtheX - inttheY - int
public Textlabel(processing.core.PApplet theComponent,
java.lang.String theValue,
int theX,
int theY,
int theW,
int theH)
theComponent - theValue - theX - theY - theW - theH - | Method Detail |
|---|
public Controller setWidth(int theValue)
setWidth in class Controllerpublic Controller setHeight(int theValue)
setHeight in class Controllerpublic void draw(processing.core.PApplet theApplet)
draw in interface CDrawabledraw in interface ControllerInterfacedraw in class ControllertheApplet - PAppletControllerDisplaypublic void setValue(float theValue)
Controller
setValue in class ControllertheValue - floatpublic void update()
Controller
update in interface ControllerInterfaceupdate in class Controllerpublic Textlabel setValue(java.lang.String theText)
theText - String
public void setPosition(float theX,
float theY)
setPosition in interface ControllerInterfacesetPosition in class ControllertheX - floattheY - floatpublic Textlabel setLetterSpacing(int theValue)
theValue - int
public void setFont(int theFont)
theFont - intpublic ControlFont setControlFont(ControlFont theControlFont)
public Label valueLabel()
Controller
valueLabel in class ControllerLabelpublic void addToXMLElement(ControlP5XMLElement theElement)
theElement - ControlP5XMLElement
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||